/**
 * 
 */
package com.wgo.bpot.wiring.ejb;

import java.util.Map;

import com.wgo.bpot.wiring.common.DomainModelConvention;

/**
 * @author PEide3
 * @FIXME: rename to EjbModelConvention
 * @TODO: rename to EjbModelConvention
 */
public interface EjbModelConventionImpl<T> extends DomainModelConvention<T> {

	public Class<? extends T> apiToEjb ( Class<? extends T> apiClass) ;
	
	public Class<? extends T> ejbToApi ( Class<? extends T> ejbClass) ;
	
	public Class<? extends T> ejbToImpl ( Class<? extends T> ejbClass) ;
	
	public Class<? extends T> implToEjb ( Class<? extends T> implClass) ;
	
	/**
	 * Converts an ejb-instance to a domain-model-instance with all relations 
	 * intact. The objects referenced to is partial-instances.
	 * 
	 * @param ejbInstance The ejb-instance to be converted.
	 * @return The converted domain-model-instance.
	 */
	public <S extends T> S convertToDomainModel( S ejbInstance, int levels, Map<String, S> cache ) ;
	
	/**
	 * Converts an domain-model-instance to a ejb-instance with all relations 
	 * intact. The objects referenced to is partial-instances.
	 * 
	 * @param ejbInstance The ejb-instance to be converted.
	 * @return The converted ejb-instance.
	 */
	public <S extends T> S convertToEjbModel( S implInstance, int levels, Map<String, S> cache ) ;
}
